#!/bin/bash
# Refer to: https://hub.docker.com/r/openresty/openresty
# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
# SPDX-License-Identifier: MulanPSL-2.0+

. $CCI_SRC/container/defconfig.sh

: ${REDIS_HOST:=172.17.0.1}
: ${REDIS_PORT:=6379}

docker_rm result-webdav

cmd=(
	docker run -d
	--name result-webdav
	--restart=always
	-p 3080:3080
	-e REDIS_HOST=$REDIS_HOST
	-e REDIS_PORT=$REDIS_PORT
	-v $PWD/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf
	-v /etc/localtime:/etc/localtime:ro
	-v /srv/result/:/srv/result/
	-v /srv/initrd/:/srv/initrd/
	-v /srv/kernel/:/srv/kernel/
	-v /srv/rpm/:/srv/rpm/
	-v /srv/tmp/rpm/:/srv/tmp/rpm/
	-v /srv/cci/build-config/:/srv/cci/build-config/
	-v /srv/cci/profile/data:/srv/cci/profile/data
	-v /srv/kunpeng:/srv/kunpeng
	result-webdav
)

"${cmd[@]}"
